﻿using System; 
using System.Configuration; 

namespace DataAccess 
{ 
    public class GlobalConfiguration 
    { 
        private static int pageSize; 
        private static string siteName; 
        private static int descriptionLength;
        private static int imagesPerPage;
        public static int PageSize 
        {
            get { return pageSize; } 
        } 
        public static int DescriptionLength 
        { 
            get { return descriptionLength; }
        }
        public static string SiteName 
        { 
            get { return siteName; }
        }
        public static int ImagesPerPage
        {
            get { return imagesPerPage; }
        }
        public static int CartPersistDays { get { return int.Parse(ConfigurationManager.AppSettings["CartPersistDays"]); } }

        static GlobalConfiguration() 
        {
            pageSize = Convert.ToInt32(ConfigurationManager.AppSettings["PageSize"]); 
            descriptionLength = Convert.ToInt32(ConfigurationManager.AppSettings["DesLength"]);
            siteName = ConfigurationManager.AppSettings["SiteName"];
            imagesPerPage = Convert.ToInt32(ConfigurationManager.AppSettings["ImagesPerPage"]);
        } 
    }
}
